package com.shiliuzi.www.mapper;

import com.shiliuzi.www.pojo.bo.LimitBo;
import com.shiliuzi.www.pojo.bo.util.DownloadExcelReadBo;
import com.shiliuzi.www.pojo.dto.download.DownloadExcelCtrlDto;
import com.shiliuzi.www.pojo.dto.download.util.DownloadExcelTypeUtil;
import com.shiliuzi.www.pojo.dto.download.util.DownloadExcelUserUtil;
import com.shiliuzi.www.pojo.entity.ExcelWriteAft;
import com.shiliuzi.www.pojo.entity.ExcelWriteBef;
import com.shiliuzi.www.pojo.po.Record;
import com.shiliuzi.www.pojo.po.RecordDefault;
import com.shiliuzi.www.pojo.po.RecordType;
import com.shiliuzi.www.pojo.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DownloadMapper {
    String getFilePath(@Param("id") Integer id);

    RecordType excelCheckTypeLYX(Integer classId);

    List<RecordDefault> excelCheckInfosLYX(Integer type, Integer finalCount, Integer finalReadLimit, String pathFile);

    Integer excelInfoPageLYX(Integer type);

    List<RecordDefault> getUserInfo(@Param("id") Integer id,@Param("identity") Integer identity);

    /**
     * 获取奖惩id
     * @param downloadExcelTypeUtil
     * @return
     */
    Integer obtainTypeId(DownloadExcelTypeUtil downloadExcelTypeUtil);

    /**
     * 获取奖惩用户
     * @param downloadExcelUserUtil
     * @return
     */
    User obtainUser(DownloadExcelUserUtil downloadExcelUserUtil);

    /**
     * 将数据导入数据库备份表中
     * @param downloadExcelReadBos
     * @return
     */
    Integer excelRead(List<DownloadExcelReadBo> downloadExcelReadBos);

    /**
     * 管理员分页查询数据
     * @param limitBo
     * @return
     */
    List<RecordDefault> excelCheckInfo(LimitBo limitBo, String pathFile);

    /**
     * 管理员获取数据量
     * @param type
     * @return
     */
    Integer excelInfoPage(Integer type);

    /**
     * 导出excel表格
     * @param index
     * @param pageSize
     * @return
     */
    List<RecordDefault> excelCheckInfos(Integer type, Integer index, Integer pageSize, String pathFile);

    /**
     * 导出excel奖惩类型
     * @param id
     * @return
     */
    RecordType excelCheckType(Integer id);

    /**
     * 管理员对excel数据操作
     * @param downloadExcelCtrlDto
     * @return
     */
    Integer excelDeleteDefault(DownloadExcelCtrlDto downloadExcelCtrlDto);

    /**
     * 读取备份表中数据
     * @param downloadExcelCtrlDto
     * @return
     */
    List<ExcelWriteBef> excelPickDefault(DownloadExcelCtrlDto downloadExcelCtrlDto);

    /**
     * 将正确数据写入数据库中
     * @param excelWriteAfts
     * @return
     */
    Integer excelWriteInfo(List<ExcelWriteAft> excelWriteAfts);
}
